package com.wzh.other;

import cn.hutool.cache.CacheUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.math.MathUtil;
import cn.hutool.core.thread.ThreadUtil;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Random;
import java.util.concurrent.CountDownLatch;
import java.util.stream.Collectors;

/**
 * @description:
 * @author: WZH
 * @time: 2021/11/4 11:26
 */
public class Demo4 {

//    public static void main(String[] args) {
//
//        ArrayList<Double> list = new ArrayList<>();
//
//        for (int i = 0; i < 50; i++) {
//
//            list.add(Math.random()*100+Math.random()*10);
//
//        }
//
//        list.forEach(s-> System.out.print(s+"\t"));
//        System.out.println();
//        System.out.println();
//
//        List<Double> list1 = list.stream().sorted().collect(Collectors.toList());
//        list1.forEach(s-> System.out.printf(s+"\t"));
////
////        new CountDownLatch();
////        ThreadUtil.execAsync();
////        ThreadUtil.newCountDownLatch(5);
////        CacheUtil.newFIFOCache(3);
//    }


    public static void main(String[] args) {
        Date now = new Date();
        String nowStr = DateUtil.format(now, "MM月dd日");
        // 周末
        DateTime endOfWeek = DateUtil.endOfWeek(now);

        // 距离周末
        long between0 = DateUtil.between(now, endOfWeek, DateUnit.DAY) - 2L;
        long between1 = DateUtil.between(now, DateUtil.parseDate("2022-01-01"), DateUnit.DAY);
        long between2 = DateUtil.between(now, DateUtil.parseDate("2022-02-01"), DateUnit.DAY);
        long between3 = DateUtil.between(now, DateUtil.parseDate("2022-02-15"), DateUnit.DAY);
        long between4 = DateUtil.between(now, DateUtil.parseDate("2022-04-05"), DateUnit.DAY);
        long between5 = DateUtil.between(now, DateUtil.parseDate("2022-05-01"), DateUnit.DAY);
        long between6 = DateUtil.between(now, DateUtil.parseDate("2022-06-03"), DateUnit.DAY);
        long between7 = DateUtil.between(now, DateUtil.parseDate("2022-09-10"), DateUnit.DAY);
        long between8 = DateUtil.between(now, DateUtil.parseDate("2022-10-01"), DateUnit.DAY);


        String message = "【摸鱼办】提醒您：%s早上好，摸鱼人！工作再累，一定不要忘记摸鱼哦！有事没事起身去茶水间，去厕所，去廊道走走别老在工位上坐着，钱是老板的,但命是自己的\n" +
                "距离周末还有：%s天\n" +
                "距离元旦还有:%s天\n" +
                "距离春节还有:%s天\n" +
                "距离元宵节还有:%s天\n" +
                "距离清明节还有:%s天\n" +
                "距离劳动节还有:%s天\n" +
                "距离端午节还有:%s天\n" +
                "距离中秋节还有:%s天\n" +
                "距离国庆节还有:%s天\n" +
                "上班是帮老板赚钱，摸鱼是赚老板的钱！最后，祝愿天下所有摸鱼人，都能愉快的渡过每一天";

        System.out.printf((message) + "%n", nowStr, between0, between1, between2, between3, between4, between5, between6, between7, between8);
    }

}
